/**
* COPYRIGHT. whx. ALL RIGHTS RESERVED.
* Project: just-core
* Author: whx <harrywu304@gmail.com>
* Create On: Apr 11, 2012 9:13:54 PM
*/

package org.justframework.api.dispatcher;

import org.justframework.core.helper.ConfigHelper;

/**
 * dispatcher factory
 */
public class DispatcherFactory {
	
	public static Dispatcher getDefaultDispatcher(){
		String defaultDispatcherName = ConfigHelper.getString("default_dispatcher");
		Class dispatcherClass = null;
		try {
			dispatcherClass = Class.forName(defaultDispatcherName);
			return (Dispatcher)dispatcherClass.newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}

}
